import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../pages/Home";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
    children: [
      {
        path: "Welcome",
        name: "Welcome",
        component: () =>
          import(/*webpackChunkName:'welocme*/ "../pages/Home/Welcome")
      },
      {
        path: "Attendance",
        name: "Attendance",
        component: () =>
          import(/*webpackChunkName:'attendance*/ "../pages/Home/Attendance")
      },
      {
        path: "Mine",
        name: "Mine",
        component: () =>
          import(/*webpackChunkName:'mine'*/ "../pages/Home/Mine")
      },
      {
        path: "Statistics",
        name: "Statistics",
        component: () =>
          import(/*webpackChunkName:'stastistics'*/ "../pages/Home/Statistics")
      },
      {
        path: "StudentManager",
        name: "StudentManager",
        component: () =>
          import(
            /*webpackChunkName:'studentmanager'*/ "../pages/Home/StudentManager"
          ),
        children: [
          {
            path: "Data",
            name: "Data",
            component: () =>
              import(
                /*webpackChunkName:'data'*/ "../pages/Home/StudentManager/Data"
              )
          },
          {
            path: "Dormitory",
            name: "Dormitory",
            component: () =>
              import(
                /*webpackChunkName:'dormitory'*/ "../pages/Home/StudentManager/Dormitory"
              )
          },
          {
            path: "Project",
            name: "Project",
            component: () =>
              import(
                /*webpackChunkName:'project'*/ "../pages/Home/StudentManager/Project"
              )
          }
        ]
      },
      {
        path: "Users",
        name: "Users",
        component: () =>
          import(/*webpackChunkName:'users'*/ "../pages/Home/Users")
      }
    ]
  },
  {
    path: "/login",
    name: "Login",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "login" */ "../pages/Login")
  }
];

const router = new VueRouter({
  routes
});

export default router;
